
		
class Map:
	def __init__(self, shape, layers, initial = 0):
		self.shape = shape
		self.map = []
		if layers == 0:
			for y in range(shape[1]):
				row = []
				for x in range(shape[0]):
					row.append(initial)
				self.map.append(row)
			self.map = [self.map]
		else:
			for l in range(layers):
				layer = []
				for y in range(shape[1]):
					row = []
					for x in range(shape[0]):
						row.append(initial)
					layer.append(row)
				self.map.append(layer)
				
	
	def get_at(self, loc, layer = 0):
		return self.map[layer][loc[1]][loc[0]]

	def set_at(self, loc, value, layer = 0):
		self.map[layer][loc[1]][loc[0]] = value
		
	def get_map(self):
		pass

	def get_path(self, start, end):
		pass

	def __getitem__(self, mi):
		#mi = (y*self.mapw)+x
		#return self.map[loc[1]][loc[0]]
		print "getting: ", mi
		
	def __setitem__(self, mi, v):
		print "setting: ", mi, v
